package com.cr.front.authentication.controller;

import com.cr.common.response.JsonResult;
import com.cr.front.authentication.pojo.dto.AuthenticationSaveParam;
import com.cr.front.authentication.pojo.vo.AuthenticationVO;
import com.cr.front.authentication.pojo.vo.LongRentVO;
import com.cr.front.authentication.service.AuthenticationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@Api(tags = "证件验证模块")
@RequestMapping("/users/authentication")
public class AuthenticationController {
    @Autowired
    private AuthenticationService authenticationService;

    @ApiOperation(value = "新增证件验证")
    @PostMapping
    public JsonResult addAuthentication(@Validated @RequestBody AuthenticationSaveParam authenticationSaveParam){
        authenticationService.addAuthentication(authenticationSaveParam);
        return JsonResult.success();
    }
    @ApiOperation(value = "查询证件验证")
    @GetMapping
    public JsonResult getAuthenticationDetail(){
        AuthenticationVO authenticationVO = authenticationService.getAuthenticationDetail();
        return JsonResult.success(authenticationVO);
    }





}
